home *** CD-ROM | disk | FTP | other *** search
- on paddleKeyDown
- global giPongEasyMode, giPlayFieldBottomBoundary, giPongStraightThru, gbPongWaves, glBulletsInPlay, giPongPaddleChannel, giPaddleHalfWidth
- set lsValidKeys to "1,2,3,4,5,6,7,8,9"
- if lsValidKeys contains the key then
- pongPaddleLevel(integer(the key))
- end if
- if the key = "f" then
- set liCount to count(glBulletsInPlay)
- if liCount < 7 then
- set liChan to liCount + 15
- set liH to the locH of sprite giPongPaddleChannel + giPaddleHalfWidth
- set liV to the locV of sprite giPongPaddleChannel - 10
- set liPos to liCount + 1
- addAt(glBulletsInPlay, 1, birth(script "bulletScript", liH, liV, 5, liChan, "Bullet", liPos))
- end if
- end if
- if the key = "e" then
- set giPongEasyMode to 1
- beep(3)
- end if
- if the key = "h" then
- set giPongEasyMode to 0
- beep(2)
- end if
- if the key = "s" then
- pongStraightThruToggle()
- end if
- if the key = "w" then
- pongWaveToggle()
- end if
- if the key = "r" then
- pongPaddleChange(random(5))
- end if
- if (the key = "q") or (the key = "Q") then
- cursor(0)
- forget(the activeWindow)
- end if
- end
-
- on pongWaveToggle
- global gbPongWaves
- if gbPongWaves then
- set gbPongWaves to 0
- else
- set gbPongWaves to 1
- end if
- end
-
- on pongStraightThruToggle
- global giPongStraightThru
- if giPongStraightThru then
- set giPongStraightThru to 0
- else
- set giPongStraightThru to 1
- end if
- end
-